package com.ruoyi.web.controller.tool;

import java.util.Arrays;
import java.util.List;

/**
 * @author 范书铭
 * @date 2024年10月08日 16:16
 */
public class ListUtils {
    public static boolean isAnswerOptionsRight(List<String> rightOptions, String userOption){
        List<String> userOptList = Arrays.asList(userOption.split(","));
        if(userOptList.size()!= rightOptions.size()){
            return false;
        }else {
            for(String rightOption : rightOptions){
                boolean findSame = false;
                for(String userOptOption : userOptList){
                    if(rightOption.equals(userOptOption)){
                        findSame = true;
                        break;
                    }
                }
                if(!findSame){
                    return false;
                }
            }
        }
        return true;
    }
}
